package com.syj.usemybatisplus.model.vo.response;

import com.alibaba.fastjson.JSONObject;

/**
 * - All rights Reserved, Designed By ShiYunJie
 * - @Package com.newland.common.constant
 * - @author: 石蕴杰
 * - @date:   2019/11/27 16:18
 * - @version V1.0
 * - @Copyright: Inc. All rights reserved.
 */
public enum EnumCommon {
    /**
     * 客户分组管理
     */
    SUCCESS("200", "成功"),
    INTER_ERROR_CODE("500", "500内部错误,请联系后台管理员!"),
    REQUEST_CODE_ERR("400","请求状态类型错误"),
    NORMAL("0","正常状态"),
    IS_DEL("1","已删除"),
    USER_LOGIN("USER_LOGIN:","用户登录前缀"),
    DEBUG_LEVEL_LOCAL("localDebug","本地调试"),
    MYBATIS_PARAMETERS("Parameters:","参数"),
    MYBATIS_PREPARING("Preparing:","预编译"),
    LOGIN_ERROR("10000", "用户名或密码不正确"),
    LOGOUT_SUCCESS("10001","退出登陆成功"),
    EXCEPTION_ERROR("10002","未知的错误"),
    PASSWORD_DECRYPT_ERROR("10003","用户密码解密失败,请检查加密方式"  ),
    COLOR_MAX(255,"颜色最大值",Integer.class),
    NUMBER_OF_INTERFERENCE_LINES(30,"干扰线条数",Integer.class),
    COLOR_CHANNELS(3,"颜色通道数",Integer.class),
    INSERT_SUCCESS("10004","插入成功"  ),
    INSERT_ERROR("10005","插入失败" ),
    ROLE_ID_NOT_EXITS("10006","角色ID不存在"),
    VERIFY_CODE_ERROR("10007", "验证码不正确"),
    ROLE_ID_ELE2ROLE_EXITS("10008","角色已分配"),
    AUTH_ID_ELE2ROLE_EXITS("10009","权限已分配"),
    AUTH_ID_ROLE2AUTH_NOT_EXITS("10010","权限ID不存在"),
    USERACCOUNT_EXIST("10011", "用户账户已存在"),
    CREATE_SESSIONID_ERROR("10012","创建福建报表工具的sessionId失败"),
    NO_PERM_ERROR("10013","很抱歉,您无权限进行当前请求!"),
    LOG_LOGIN_TYPE("1","登陆退出"),
    LOG_NORMAL_TYPE("2","普通操作"),
    API_LOGIN("/login/doLogin","登陆"),
    API_LOGOUT("/login/doLogout","退出"),
    API_ASSIGN_ROLE("/user/assignRole","授予角色"),
    NOT_LOGIN_ERROR("10014","很抱歉,您尚未登陆!"),
    JSON_OBJECT("JSONObject","JSONObject"),
    JSON_ARRAY("JSON_ARRAY","JSON_ARRAY"),
    SYNC_ALL_ORG_FAIL("10015","同步所有机构失败"),
    SYNC_FJ_RESPONSE("respErrorMsg","福建报表工具同步返回值"),
    SYNC_ALL_USER_FAIL("10016","同步所有用户失败"),
    DEPLOY_ERROR("10017","部署失败"),
    DEPLOY_SUCCESS("10018","部署成功"),
    FIND_TASK_BY_ASSIGNEE_ERROR("10019","根据流程assignee查询当前人的个人任务"),
    SPONSOR_LEVEL3MANAGER_NOT_EXISTS("10020","发起人所在部门未分配三级负责人" ),
    APPROVAL_LEVEL3MANAGER_NOT_EXISTS("10021", "接收方所在部门未分配三级负责人"),
    SPONSOR_LEVEL2MANAGER_NOT_EXISTS("10022","发起人所在部门未分配二级负责人" ),
    APPROVAL_LEVEL2MANAGER_NOT_EXISTS("10023", "接收方所在部门未分配二级负责人"),
    HAS_READ("2","已读"),
    TREE_ROOT("0","树根节点");

    private Object code;

    private String message;

    <T> EnumCommon(T code, String message, Class<T> clazz) {
        this.code = code;
        this.message = message;
    }

    EnumCommon(String code, String message)
    {
        this.code = code;
        this.message = message;
    }

    public  String getCode()
    {
        return code.toString();
    }

    public String getmessage() {
        return message;
    }

    @Override
    public String toString() {
        JSONObject json = new JSONObject();
        json.put("code",this.code);
        json.put("message",this.message);
        return json.toString();
    }

}
